//自动点赞
auto();
device.keepScreenOn();
var num = rawInput("刷多少次", "");
launchApp("抖音短视频");
//sleep("9000");
text("朋友").waitFor()
toastLog('抖音界面,延迟3秒')
sleep(3000)
for (let index = 0; index < num; index++) {
    swipe(device.width - 200, device.height - 500, device.width - 200, device.height / 5, 500)
    sleep(random(15000,20000))
auto.setWindowFilter(function (window) {
    return true;
});
let btn = descContains("喜欢").className("android.widget.ImageView").boundsInside(0, device.height * 0.1, device.width, device.height * 0.9).findOne(5000)   //934,840,1065,971
if (btn != null) {
    if (btn.desc().match("未选中")) {  //0, device.height * 0.1, device.width, device.height * 0.9
        if (btn.desc().match("w")) {
            toastLog("当前点赞数量过万")
            btn.parent().click()
        }
    }
    if (btn.desc().match("已选中")) {
        toastLog('已经点赞过')
    }
} else {
    toastLog("未找到点赞按钮")
}
sleep(random(1000, 5000))
}
